package com.scedu.demo4;

import com.scedu.demo3.Host;

import com.scedu.demo3.Rent;

public class Client {
    public static void main(String[] args) {
        //真实角色
        Host host=new Host();
        //代理角色:现在没有
        ProxyInvocationHandler proxyInvocationHandler = new ProxyInvocationHandler();
        //通过调用程序处理角色来处理我们要调用的接口对象
        proxyInvocationHandler.setTarget(host);//设置要代理的对象
        Rent proxy=(Rent) proxyInvocationHandler.getProxy(); //动态生成代理类
        proxy.rent();
    }
}
